from base.base import BaseAssert
from base.search_base import SearchBase


class SearchPage(SearchBase):

    def search_box_for_input_send(self, driver, value):
        search_box_for_input_xpath = self.search_box_for_input()
        self.send_keys_new(driver, locator_value=search_box_for_input_xpath, value=value)

    def search_button_click(self, driver):
        search_button_xpath = self.search_button()
        self.click_new(driver, locator_value=search_button_xpath)

    def get_book_title_text(self, driver):
        book_title_xpath = self.book_tile()
        return self.get_text(driver, locator_value=book_title_xpath)
